<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //传统方式定义对象
        const  name  =  "lucy"
        const  age  =  20
        const  user1  =   {
                name: name,
                age: age
            }
            //console.log(user1)
            //es6
        const  user2  =   {
            name,
            age
        }
        console.log(user2)
    </script>
</body>

</html>